import flash.filters.DropShadowFilter;
/**
 * ...
 * @author back2dos
 */
class Util {
	public static function plot(f:Function, target:MovieClip, h:Number, w:Number,x:Number, y:Number) {
		target = target || _root;
		var d:Number = target.getNextHighestDepth();
		target = target.createEmptyMovieClip('plot' + d, d);
		
		target.filters = [new DropShadowFilter(3, 45, 0, .50, 4, 4, 1, 3)];
		target.opaqueBackground = 0xFFFFFF;
		target.lineTo(0, h);
		target.lineTo(w, h);
		target.lineTo(w, 0);
		target.lineStyle(0, 0, 50);
		target.moveTo(0, .25 * h);
		target.lineTo(w, .25 * h);
		target.moveTo(0, .75 * h);
		target.lineTo(w, .75 * h);
		target.lineStyle(1, 0x4488);
		
		target.moveTo(0, .75 * h);
		for (var i:Number = 0; i <= w; i++) {
			target.lineTo(i, h * (.75 - .5 * f(i / w)));
		}
		target._x = x || 10;
		target._y = y || 10;
	}
}